home *** CD-ROM | disk | FTP | other *** search
/ Armageddon - Interactive Preview / Interactive Preview: Armageddon.iso / pc / control.dxr / Scripts & Behaviors_31_Mug Behavior.ls < prev    next >
Encoding:
Text File  |  1998-05-19  |  4.7 KB  |  174 lines

  1. property pThisSprite
  2.  
  3. on new me
  4.   set pThisSprite to the currentSpriteNum
  5. end
  6.  
  7. on mouseDown me
  8.   set the locV of sprite pThisSprite to the locV of sprite pThisSprite - 4
  9.   updateStage()
  10.   repeat while the stillDown
  11.     set the locH of sprite pThisSprite to the mouseH
  12.     if the locH of sprite pThisSprite < 0 then
  13.       set the locH of sprite pThisSprite to 0
  14.     end if
  15.     if the locH of sprite pThisSprite > 640 then
  16.       set the locH of sprite pThisSprite to 640
  17.     end if
  18.     updateStage()
  19.   end repeat
  20. end
  21.  
  22. on mouseUp me
  23.   set temp to random(6)
  24.   set the locV of sprite pThisSprite to the locV of sprite pThisSprite + 4
  25.   puppetSound("Cup Down")
  26.   updateStage()
  27.   case temp of
  28.     1:
  29.       nothing()
  30.     2:
  31.       color(me)
  32.     3:
  33.       slide(me)
  34.     4:
  35.       teleport(me)
  36.     5:
  37.       drop(me)
  38.     6:
  39.       spin(me)
  40.   end case
  41. end
  42.  
  43. on mouseEnter me
  44.   cursor(260)
  45. end
  46.  
  47. on mouseLeave me
  48.   cursor(0)
  49. end
  50.  
  51. on color me
  52.   puppetSound(4, "Disco")
  53.   repeat with loop = 1 to 10
  54.     set the member of sprite pThisSprite to "Cycle 1"
  55.     updateStage()
  56.     set thisMember to the memberNum of sprite pThisSprite
  57.     repeat with x = 1 to 7
  58.       if soundBusy(4) then
  59.         set the memberNum of sprite pThisSprite to thisMember + x
  60.         updateStage()
  61.         next repeat
  62.       end if
  63.       exit repeat
  64.     end repeat
  65.     set the member of sprite pThisSprite to "Still Mug"
  66.     updateStage()
  67.   end repeat
  68. end
  69.  
  70. on slide me
  71.   set temp to random(2)
  72.   set thisH to the locH of sprite pThisSprite
  73.   case temp of
  74.     1:
  75.       set the locH of sprite pThisSprite to the locH of sprite pThisSprite - 50
  76.       puppetSound(4, "Slide Sound Out")
  77.       updateStage()
  78.       repeat while the locH of sprite pThisSprite > -50
  79.         set the locH of sprite pThisSprite to the locH of sprite pThisSprite - 50
  80.         updateStage()
  81.       end repeat
  82.       set the locH of sprite pThisSprite to 700
  83.       puppetSound(4, "Slide Sound In")
  84.       updateStage()
  85.       repeat while the locH of sprite pThisSprite > thisH
  86.         set the locH of sprite pThisSprite to the locH of sprite pThisSprite - 50
  87.         if the locH of sprite pThisSprite < thisH then
  88.           set the locH of sprite pThisSprite to thisH
  89.           updateStage()
  90.           exit repeat
  91.         end if
  92.         updateStage()
  93.       end repeat
  94.     2:
  95.       set the locH of sprite pThisSprite to the locH of sprite pThisSprite + 50
  96.       puppetSound(4, "Slide Sound Out")
  97.       updateStage()
  98.       repeat while the locH of sprite pThisSprite < 700
  99.         set the locH of sprite pThisSprite to the locH of sprite pThisSprite + 50
  100.         updateStage()
  101.       end repeat
  102.       set the locH of sprite pThisSprite to -50
  103.       puppetSound(4, "Slide Sound In")
  104.       updateStage()
  105.       repeat while the locH of sprite pThisSprite < thisH
  106.         set the locH of sprite pThisSprite to the locH of sprite pThisSprite + 50
  107.         if the locH of sprite pThisSprite > thisH then
  108.           set the locH of sprite pThisSprite to thisH
  109.           updateStage()
  110.           exit repeat
  111.         end if
  112.         updateStage()
  113.       end repeat
  114.   end case
  115.   set the locH of sprite pThisSprite to thisH
  116. end
  117.  
  118. on teleport me
  119.   set temp to random(600) + 10
  120.   set the blend of sprite pThisSprite to 100
  121.   set thisBlend to 100
  122.   puppetSound(4, "Teleport")
  123.   updateStage()
  124.   repeat while the blend of sprite pThisSprite > 0
  125.     set the blend of sprite pThisSprite to thisBlend
  126.     updateStage()
  127.     set thisBlend to thisBlend - 10
  128.   end repeat
  129.   set thisBlend to 0
  130.   set the blend of sprite pThisSprite to thisBlend
  131.   set the locH of sprite pThisSprite to temp
  132.   updateStage()
  133.   repeat while the blend of sprite pThisSprite < 100
  134.     set the blend of sprite pThisSprite to thisBlend
  135.     updateStage()
  136.     set thisBlend to thisBlend + 10
  137.   end repeat
  138. end
  139.  
  140. on drop me
  141.   set newMember to the memberNum of sprite pThisSprite
  142.   repeat with x = 1 to 6
  143.     set the memberNum of sprite pThisSprite to newMember + 1
  144.     set newMember to newMember + 1
  145.     updateStage()
  146.   end repeat
  147.   set thisBlend to 0
  148.   set temp to random(600) + 10
  149.   set the blend of sprite pThisSprite to thisBlend
  150.   set the member of sprite pThisSprite to "Still Mug"
  151.   set the locH of sprite pThisSprite to temp
  152.   puppetSound(4, "Broke Mug")
  153.   updateStage()
  154.   repeat while the blend of sprite pThisSprite < 100
  155.     set the blend of sprite pThisSprite to thisBlend
  156.     updateStage()
  157.     set thisBlend to thisBlend + 10
  158.   end repeat
  159. end
  160.  
  161. on spin me
  162.   set the member of sprite pThisSprite to "Spin 01"
  163.   set thisMember to the memberNum of sprite pThisSprite
  164.   updateStage()
  165.   repeat with loop = 1 to 1
  166.     repeat with x = 1 to 16
  167.       set the memberNum of sprite pThisSprite to thisMember + x
  168.       updateStage()
  169.     end repeat
  170.   end repeat
  171.   set the member of sprite pThisSprite to "Still Mug"
  172.   updateStage()
  173. end
  174.